/**
 * @Author：ming
 * @Date：2023/10/9 4:01 AM
 * @Filename：Lc111
 */

import java.util.ArrayList;
import java.util.List;

/**
 * @author ming
 */
public class Lc94 {
    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> list = new ArrayList<>();
        inOrder(root,list);
        return list;
    }

    public static void inOrder(TreeNode root, List<Integer> list){
        if(root==null){
            return;
        }
        inOrder(root.left,list);
        list.add(root.val);
        inOrder(root.right,list);
    }
}
